import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './common/css/global.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// Vue.prototype.$axios = axios
createApp(App)
.use(router)
.use(store)
.use(ElementPlus)
.mount('#app')
// const app = createApp(App)
// app.use(router)
// app.mount("#app")
const debounce = (fn, delay) => {
    let timer
     return (...args) => {
       if (timer) {
         clearTimeout(timer)
       }
       timer = setTimeout(() => {
         fn(...args)
       }, delay)
     }
  }
    
  const _ResizeObserver = window.ResizeObserver;
  window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
     constructor(callback) {
       callback = debounce(callback, 200);
       super(callback);
     }
  }